load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
    name = "io_bazel_rules_docker",
    sha256 = "59d5b42ac315e7eadffa944e86e90c2990110a1c8075f1cd145f487e999d22b3",
    strip_prefix = "rules_docker-0.17.0",
    urls = ["https://github.com/bazelbuild/rules_docker/releases/download/v0.17.0/rules_docker-v0.17.0.tar.gz"],
)

load(
    "@io_bazel_rules_docker//repositories:repositories.bzl",
    container_repositories = "repositories",
)
container_repositories()

load("@io_bazel_rules_docker//repositories:deps.bzl", container_deps = "deps")

container_deps()

load(
    "@io_bazel_rules_docker//container:container.bzl",
    "container_pull",
)

container_pull(
  name = "python_base",
  registry = "index.docker.io",
  repository = "python",
  tag = "3.8-slim",
)

http_archive(
  name = "subpar",
  strip_prefix = "subpar-2.0.0",
  urls = ["https://github.com/google/subpar/archive/2.0.0.tar.gz"],
)

http_archive(
    name = "rules_python",
    url = "https://github.com/bazelbuild/rules_python/releases/download/0.1.0/rules_python-0.1.0.tar.gz",
    sha256 = "b6d46438523a3ec0f3cead544190ee13223a52f6a6765a29eae7b7cc24cc83a0",
)

load("@rules_python//python:pip.bzl", "pip_install")

pip_install(
  name = "handler_deps",
  requirements = "//handler:requirements.txt",
)

pip_install(
  name = "publisher_deps",
  requirements = "//publisher:requirements.txt",
)

http_archive(
  name = "protoc",
  url = "https://github.com/protocolbuffers/protobuf/releases/download/v3.14.0/protoc-3.14.0-linux-x86_64.zip",
  build_file_content = """
filegroup(
  name = "bin",
  srcs = ["bin/protoc"],
  visibility = ["//visibility:public"],
)

filegroup(
  name = "includes",
  srcs = glob(["**/*.proto"]),
  visibility = ["//visibility:public"],
)
  """,
)
